package com.ymatou.iapi.userservice.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

/**
 * 修改登入账户信息Call FreeMaker Template自动生成代码
 */
public class GUserLogoRequestDtoCall extends YmatouBaseCall {
	private static String opurl = "json/reply/UserLogoRequestDto";

	public GUserLogoRequestDtoCall() {
		super(EnvSetup.getSystemUrl("userservice_iapi"), opurl, "GET", "PARAM");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	/**
	 * 获取Success
	 * 
	 * @return
	 */
	public boolean getSuccess() {
		boolean Success = false;
		try {
			Success = new JSONObject(getReturnData()).getBoolean("Success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Success;
	}

	/**
	 * 获取Result
	 * 
	 * @return
	 */
	public boolean getResult() {
		boolean Result = false;
		try {
			Result = new JSONObject(getReturnData()).getBoolean("Result");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Result;
	}

	/**
	 * 获取ResponseCode
	 * 
	 * @return
	 */
	public String getResponseCode() {
		String ResponseCode = null;
		try {
			ResponseCode = new JSONObject(getReturnData()).getString("ResponseCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ResponseCode;
	}

	/**
	 * 获取LastErrorMessage
	 * 
	 * @return
	 */
	public String getLastErrorMessage() {
		String LastErrorMessage = null;
		try {
			LastErrorMessage = new JSONObject(getReturnData()).getString("LastErrorMessage");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return LastErrorMessage;
	}
}